package com.vote.dao;

import org.hibernate.criterion.DetachedCriteria;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.vote.dao.util.HibernateDao;
import com.vote.dao.util.Page;
import com.vote.entity.AnswerInfo;

@Repository
public class AnswerInfoDao extends HibernateDao<AnswerInfo, Long> {
	
	private static Logger logger = LoggerFactory.getLogger(AnswerInfoDao.class);
	
	public Page<AnswerInfo> listByPage(Page<AnswerInfo> page, DetachedCriteria detach) {
		return this.findPage(page, detach);
	}
	
	public Long getAnswerInfoCnt(String ip,String cookie){		
		String hql="from AnswerInfo a where ip=? and cookie=?";
		Long cnt=this.countHqlResult(hql, ip,cookie);		
		return cnt;
	}
	
	
}